$(document).ready(function(e) {
	
	
});


/*--------------------- Drop Down Menu Start -----------------------*/
var timeout	= 1;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	//alert($('.'+id).parent().html());
	mcancelclosetime();
	// close old layer
	if(ddmenuitem) ddmenuitem.style.display = 'none';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	var pos = $('.'+id).offset();
	var pos2 = $('.wrapper').offset();
	
	if($('#'+id).closest('div').parent().hasClass('prflDropDowns')){
		$(ddmenuitem).css( { "left": (pos.left) + "px", "top":pos.top + 23 + "px" } );
	}
	else{
		$(ddmenuitem).css( { "left": (pos.left) + "px", "top":"67px"});
	}
	
	ddmenuitem.style.display = 'block';
	jQuery.each($('.logoArea nav a'), function() {
		$(this).removeClass("current");
	});
	$('.'+id).addClass('current');
}
// close showed layer
function mclose()
{
	jQuery.each($('.logoArea nav a, .prflFilters a'), function() {
		$(this).removeClass("current");
	});
	if(ddmenuitem) ddmenuitem.style.display = 'none';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}


